<?php
@header("Content-Type:text/html;charset=utf-8");
@include_once("conn.php");

if(!(isset($_GET['userInp']) && isset($_GET['pwdInp']) && isset($_GET['phoneInp']) && isset($_GET['emailInp']))){
    $obj = array();
    $obj["status"] = false;
    $obj["msg"] = '请输入完整的参数';
    $json = json_encode($obj);
    exit($json);
}

$user = $_GET['userInp'];
$pwd = $_GET['pwdInp'];
$phone = $_GET['phoneInp'];
$email = $_GET['emailInp'];

$sql = "insert into `userinfos` (user,pwd,phone,email) values ('$user','$pwd','$phone','$email')";


$result = mysqli_query($conn,$sql);
$obj = array();
if($result){
   $rows = mysqli_affected_rows($conn);

    if($rows>0){
        $obj["status"] = true;
        $obj["msg"] = "新增成功";

    }else{
        $obj["status"] = false;
        $obj["msg"] ='新增失败';
    }
}else{
    $obj["status"] = 'sql语句有误';
    $obj["msg"] = '';
    
}
echo json_encode($obj);
?> 